package com.hxy.tlias.exception;

import com.hxy.tlias.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GLobalExceptionHandler {

    @ExceptionHandler
    public Result doException(Exception e) {
        log.error("出现异常：{}", e.getMessage());
        return Result.error("出错了，请联系管理员");
    }
}
